<?php

class HashBehavior extends CActiveRecordBehavior
{
	public $field = '';

	public function beforeSave($event){
		if($this->owner->isNewRecord)
			$this->owner->{$this->field} = md5(Users::SALT.$this->owner->{$this->field});
	}
}